package com.imooc.utils;

import com.imooc.VO.ResultVO;

/**
 * @author Leevan
 * @Date 2018/8/15 10:16
 */
public class ResultVOUtil {

    //返回成功
    public static ResultVO success(Object object){
        ResultVO resultVO=new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0);
        resultVO.setMsg("Success");
        return resultVO;
    }
    //返回为空
   public static ResultVO success(){
        return success(null);
   }
    //返回失败
   public static ResultVO error(Integer code,String msg){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
   }

}
